package com.dap.test;


import com.dap.dubbo.service.HelloService;
import com.dap.dubbo.service.TestHello;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AppCustomer2 {

    private HelloService helloService;
    @Before
    public void before() {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"dubbo-client2.xml"});
        helloService = (HelloService) context.getBean("helloService", HelloService.class);
    }

    @Test
    public void test()  throws Exception{
        try {
            for (int i = 0; i <=3000; i++) {
                  new Thread(new TestHello(i,helloService)).start();
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        System.out.println("Customer started.");

       // System.in.read(); // press any key to exit
    }
}
